//
//  LXStatus.m
//  微了个小博
//
//  Created by imera on 15/9/24.
//  Copyright (c) 2015年 imera. All rights reserved.
//

#import "LXStatus.h"
#import "MJExtension.h"
#import "LXPhoto.h"

@implementation LXStatus

/**
 * 对象中的数组转模型
 */
- (NSDictionary *)objectClassInArray
{
    return @{@"pic_urls":[LXPhoto class]};
}

- (void)setCreated_at:(NSString *)created_at
{
   // NSLog(@"%@",created_at);
    NSDateFormatter *fmt = [[NSDateFormatter alloc]init];
    fmt.dateFormat = @"EEE MMM dd HH:mm:ss Z yyyy";
    NSDate *date = [fmt dateFromString:created_at];
    
    
    fmt.dateFormat = @"MM月dd号 HH:mm";
    _created_at = [fmt stringFromDate:date];
}

- (void)setSource:(NSString *)source
{
    NSInteger location = [source rangeOfString:@">"].location + 1;
    NSInteger length = [source rangeOfString:@"</"].location - location;
    if(length > 0){
        source = [source substringWithRange:NSMakeRange(location, length)];
        _source = [NSString stringWithFormat:@"来自%@",source];
    }else{
        _source = @"未知来源";
    }
}
@end

